MIDIInQueue
(Event)

Purpose: Fires after a MIDI-Message is recieved.

Syntax: See Example.

Arguments:
MessageQueue is An object containing an the MIDI-message queue.
MessageQueue has one Property:
IsEmpty, a Boolean returning True if the Queue is empty
and one Method:
Pop Message As Integer, Data1 As Integer, Data2 As Integer, TimeStamp As Integer
which fills variables with the next values in the Queue.

Example:
'Print Messages to Debug Window
Private Sub SoundCard1_MIDIInQueue(MessageQueue as Object)
____Dim Message As Integer
____Dim Data1 As Integer
____Dim Data2 As Integer
____Dim TimeStamp As Integer
____Do Until MessageQueue.IsEmpty
________MessageQueue.Pop Message, Data1, Data2, TimeStamp
________Debug.Print Message
____Loop
End Sub

Comments: The MIDIInQueue Event is the safe way to get MIDI-In messages as opposed to the MIDIInQueueCALLBACK Event. Note that these two Events uses the same MessageQueue Object. If you pop data from the queue in MIDIInQueueCALLBACK then the queue will be empty when MIDIInQueue is fired.

See Also:
MIDIInQueueCALLBACK

Index